﻿namespace Delegatedemo6
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = new List<string>();
            list.Add("a");
            list.Add("ab");
            list.Add("abb");
            list.Add("abbb");
            list.Add("aabab");
            list.Add("abaab");
            list.Add("abaaab");

            Predicate<string> p = (string s) => s.StartsWith("a");
            bool find = list.Exists(p);
            Console.WriteLine(find);

            Action<string> print = (string s) => Console.WriteLine(s.Length);
            list.ForEach(print);

            Func<string, int> len = (string s) => { return s.Length; };
            Console.WriteLine(len("abbcdf"));
        }
    }
}